package com.f6.menuUtils;

import com.f6.common.constants.CommonCanstants;


/**
 * 菜单管理器类
 * 
 * @author 彭松
 * @date 2013-09-10
 */
public class MenuManager {
	
	public static void main(String[] args) {
		// 调用接口获取access_token
	/*	AccessToken at = WeixinUtil.getAccessToken(CommonCanstants.appId_niuwowo_jiamusi, CommonCanstants.appSecret_niuwowo_jiamusi);
		//AccessToken at = TokenThread.accessToken;
        System.out.println(at.getToken()); 
		if (null != at) {
			// 调用接口创建菜单
			int result = WeixinUtil.createMenu(getMenu(),at.getToken());

			// 判断菜单创建结果
			if (0 == result)
				System.out.println("菜单创建成功！");
			else
				System.out.println("菜单创建失败，错误码：" + result);
		}*/
	}

	/** 
     * 组装菜单数据 
     *  
     * @return 
     */  
   /* private static Menu getMenu() { 
    	CommonButton btn11 = new CommonButton();  
	    btn11.setName("我要代言");  
	    btn11.setType("click");  
	    btn11.setKey("11");
	    
	    CommonButton btn12 = new CommonButton();  
	    btn12.setName("代言概况");  
	    btn12.setType("click");  
	    btn12.setKey("12");
        
        ComplexButton mainBtn1 = new ComplexButton();  
        mainBtn1.setName("主页");  
        mainBtn1.setType("view");
        //https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx4824fb72bd707d7a&redirect_uri=http://weixin.f6car.com/WxOAuthController&response_type=code&scope=snsapi_base&state=wx4824fb72bd707d7a&connect_redirect=1#wechat_redirect
        mainBtn1.setUrl("https://open.weixin.qq.com/connect/oauth2/authorize?appid="+CommonCanstants.appId_shuangniu+"&redirect_uri=http%3A%2F%2Fweixin.f6car.com%2FWxOAuthController&response_type=code&scope=snsapi_base&state="+CommonCanstants.appId_shuangniu+"|0|APPSERCET&connect_redirect=1#wechat_redirect");
        
        ComplexButton mainBtn2 = new ComplexButton();  
        mainBtn2.setName("活动");  
        mainBtn2.setSub_button(new Button[] {btn11,btn12});
    	
//    	ViewButton btn11 = new ViewButton();
//    	btn11.setName("陪聊吐槽");
//    	btn11.setType("view");
//    	btn11.setUrl("http://mp.weixin.qq.com/s?__biz=MzAxMjcyNTQ5Ng==&mid=400795007&idx=1&sn=fe7c0bf3fedc6546bc87c657dbe8569f&scene=18#rd");
//    	
//    	CommonButton btn21 = new CommonButton();
//    	btn21.setName("粉丝福利");
//    	btn21.setType("click");
//    	btn21.setKey("che21");
//    	
//    	ViewButton btn31 = new ViewButton();
//    	btn31.setName("小贱趴");
//    	btn31.setType("view");
//    	btn31.setUrl("http://mp.weixin.qq.com/s?__biz=MzAxMjcyNTQ5Ng==&mid=400589498&idx=1&sn=1361b4d6f1c7e446e1ca08eaa3530d65&scene=18#rd");
        *//** 
         * 这是公众号xiaoqrobot目前的菜单结构，每个一级菜单都有二级菜单项<br> 
         *  
         * 在某个一级菜单下没有二级菜单的情况，menu该如何定义呢？<br> 
         * 比如，第三个一级菜单项不是“更多体验”，而直接是“幽默笑话”，那么menu应该这样定义：<br> 
         * menu.setButton(new Button[] { mainBtn1, mainBtn2, btn33 }); 
         *//*  
        Menu menu = new Menu();  
        menu.setButton(new Button[] {mainBtn2});  
  
        return menu;  
    }  */
}
